home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
033a
/
sb_event.zip
/
SB_UPL.PRG
< prev
next >
Wrap
Text File
|
1990-07-29
|
6KB
|
218 lines
*****************************************
*
* This file generates the top ten uploaders either
* manualy or with the "SBEVENT" parameter.
*
* This will serve as an example as to the parameter passing.
* Nothing fancy at all, it simply says if there is a PCOUNT() > 0 etc..
* AND YOU KNOW THE REST.
*
* Feel free to use this code if you choose. It's only ASCI but it works.
* It basicly is similar to the allfiles prg.
* At the bottom of this file there is also a little batch run prg.
* I havn't set the prg for the DOS command yet but will find the time
* soon I hope.
*!*********************************************************************
*!
*! Procedure: UPGEN
*!
*!
*! Calls: SETNDX() (function in SBSUPP.PRG)
*! : OPEN_ERROR() (function in SB_ERR.PRG)
*! : STATBOX() (function in SBINIT.PRG)
*! : CLR() (function in ?)
*! : ADD_REC() (function in SBSUPP.PRG)
*! : REC_LOCKER() (function in SBSUPP.PRG)
*! : CHOP() (function in SBSUPP.PRG)
*! : CLOSEFILE() (function in SBSUPP.PRG)
*!
*! Uses: MAINDIR.DBF
*!
*! Indexes: TEMP.NTX
*! : FILE("TEMP.NTX")
*!
*! Other Files: &ASCFILE
*!
*!*********************************************************************
PROCEDURE upgen
PARAMETER upgen1
PRIVATE num_param,event,u_name,s_name
num_param = PCOUNT()
DO CASE
CASE num_param = 0
event = .F.
CASE num_param = 1
event = .T.
ENDCASE
SELECT 4
IF NET_USE(maindir,"BULLET",SHARED,10)
setndx(maindir,"BUL_X")
ELSE
open_error("SBBULL",Procline(),"Unable to open " + maindir + "BULLET.DBF","","")
ENDIF
? CHR(7)
IF event
statbox("Updating the TOP TEN UPLOADERS bulletin")
ELSE
@ 23,0
clr(02,01,18,52)&&
SETCOLOR(gblink)
? CHR(7)
@ 10,3 SAY "Creating and/or updating TOP TEN UPLOADERS bulletin"
ENDIF
SETCOLOR(cyan)
SELECT bullet
LOCATE FOR "TOP"$UPPER(DESC) .AND. "UP"$UPPER(DESC)
IF ! FOUND()
GOTO BOTTOM
Nextkey = KEY + 1
add_rec(0)
REPLACE KEY WITH Nextkey
UNLOCK
ENDIF
rec_locker(0)
REPLACE DESC WITH "Top 10 UP-LOADERS"
REPLACE DATE WITH DATE()
UNLOCK
ascfile = TRIM(sbparms->sbulldir)+"SBB"+chop(KEY)+".ASC"
SELECT 1
IF NET_USE(maindir,"USER",EXCLUSIVE,10)
INDEX ON 500 - no_of_up TO temp
setndx(maindir,"TEMP")
ELSE
open_error("SBBULL",Procline(),"Unable to open " + maindir + "USER.DBF","","")
ENDIF
SET CONSOLE OFF
***************
*
* This is the ASCII FILE CREATION
*
***************************************
SET ALTERNATE TO &ascfile
SET ALTERNATE ON
?? CHR(12)
?? " >>---> The TOP TEN <---<< A listing of the top uploaders as of "+;
DTOC(DATE())
? "╔" + REPLICATE("═",77) + "╗"
Fcount = 1
GOTO TOP
DO WHILE Fcount <= 10
u_name = UPPER(TRIM(first))+UPPER(TRIM(LAST))
s_name = UPPER(TRIM(sbparms->sysop_f))+UPPER(TRIM(sbparms->sysop_l))
IF u_name = s_name
SKIP
LOOP
ENDIF
top_up = TRIM(first)+" "+TRIM(LAST)
? "║ " + top_up + SPACE(35-LEN(top_up))
?? STR(no_of_up,6,0) + " "
?? city+" "+state+" ║"
Fcount = Fcount + 1
IF Fcount < 11
? "╟"+REPLICATE("─",77) + "╢"
ENDIF
SKIP
ENDDO
? "╚" + REPLICATE("═",77) + "╝"
? " "
SET ALTERNATE OFF
CLOSE ALTERNATE
closefile("BULLET")
closefile("USER")
SELECT 1
IF NET_USE(maindir,"USER",SHARED,0)
setndx(maindir,"USER_N","USER_U")
ELSE
open_error("SBBULL",Procline(),"Unable to open " + maindir + "USER.DBF","","")
ENDIF
IF FILE("TEMP.NTX")
ERASE FILE("TEMP.NTX")
ENDIF
IF event
SELECT sb_event
ENDIF
INKEY(2)
RETURN
***************************************
*
* This is my very crude and rude auto-backup
* of everything thats important to me that is kept in
* the main BBS directory. This program calls a DOS
* batch file (which I have included ). Just to give you
* a few ideas how I handle this evil thought of loosing
* everything in the directory (which has happened).
* The batch file calls a norton utility "FA" to reset the
* file attributes, I know you can do this in the "F" commands
* in Clipper but this was simpler for me. Anyway here it is
* you will like it I am sure.
*
* Notice, in the batch file that I copy yesterdays backup to
* another directory so you always have 2 copies on hand, much safer
* and they are ZIPED so it's not a bunch of space. Of course ALL of the
* dbf's were closed while doing this and then reopened in their
* proper mode. All I do is call the INDEX PROC. and it takes care
* of everything else.
*
*!*********************************************************************
*!
*! Procedure: BAKITUP
*!
*! Calls: CLOSEFILE() (function in SBSUPP.PRG)
*! : STATBOX() (function in SBINIT.PRG)
*! : OPEN_ERROR() (function in SB_ERR.PRG)
*!
*! Uses: MAINDIR.DBF
*!
*!*********************************************************************
PROCEDURE bakitup
*******************
*
* First I close everything "ALL DATAFILES" in case
* it dumps. Thats not been a problem but better to
* be safe.
*
*******************
closefile("sbparms")
closefile("user")
? CHR(7)
statbox("Backing up all DATABASE,SCREEN,BATCH & LOG files")
@ 0,0
****************
* Here is where I "RUN " the batch
****************
RUN bbsbak.bat
SELECT 9
IF ! NET_USE(maindir,"SBPARMS",SHARED,10)
open_error("SBINIT",Procline(),"Unable to open " + maindir + "SBPARMS.DBF","","")
CLOSE DATA
CLEAR
QUIT
ENDIF
GOTO NODE
RETURN